
	******************************************************************
	**
	**
	**		NAME:		GUY GROSSMAN, YOTAM MARGALIT, TAMAR MITTS
	**		DATE: 		December 15, 2021
	**		PROJECT: 	Israel Hayom
	**		DETAILS: 	This code generates Table SI-10
	**		Version: 	Stata MP 16
	**
	******************************************************************
	
			**	**	**	**	**	**	**	**	**	**	**	**	**
			**	**	**	**	**	**	**	**	**	**	**	**	**
			**	**	**	**	**	**	**	**	**	**	**	**	**

clear
version 16
set scheme plotplain
set more off

capture cd "~/dropbox/Israeli Newspapers Study/JOP_REPLICATION/Dataverse submission"

* bring in period dataset at locality level

use "Data/yeshuv_period_final_Figs.dta", clear
tsset uniqueid period
sort uniqueid period
	
// define covariates
gl interactions i.period#c.ltd i.period#c.lpop i.period#c.matriccert_pcnt_08 i.period#c.europe_pcnt_08 i.period#c.pop_share1829 i.period#c.pop_share3049 i.period#c.pop_share5065 i.period#c.pop_share66 i.period#c.religion_pcnt i.period#c.asia_pcnt_08
su $interactions

gl covs ltd lpop matriccert_pcnt_08 europe_pcnt_08 pop_share1829 pop_share3049 pop_share5065 pop_share66 asia_pcnt_08 religion_pcnt
su $covs

**************************************************************************
* Regression for the two-period FD with cumulative Israel-Hayom exposure *
**************************************************************************

estimates drop _all

foreach var in BRB {  

* OLS model for 2013 - No covariates

bootstrap, reps(250) seed(1712) cl(area_num) idcl(new_area_num) group(uniqueid) force: reg `var'D2 IHEC `var'Pre if period==3  [aw=potential], cl(area_num)
	estadd local Model "OLS"
	estadd local covs "no"
	estadd local base "yes"
	capture est sto `var'19
		
* OLS model for 2013 - With covariates

bootstrap, reps(250) seed(1712) cl(area_num) idcl(new_area_num) group(uniqueid) force: reg `var'D2 IHEC `var'Pre $covs if period==3 [aw=potential], cl(area_num)
	estadd local Model "OLS"
	estadd local covs "yes"
	estadd local base "yes"
	capture est sto `var'20	

* OLS model for 2015 - No covariates

bootstrap, reps(250) seed(1712) cl(area_num) idcl(new_area_num) group(uniqueid) force: reg `var'D3 IHEC `var'Pre if period==4 [aw=potential], cl(area_num)
	estadd local Model "OLS"
	estadd local covs "no"
	estadd local base "yes"
	capture est sto `var'21

* OLS model for 2015 - With covariates

bootstrap, reps(250) seed(1712) cl(area_num) idcl(new_area_num) group(uniqueid) force: reg `var'D3 IHEC `var'Pre $covs if period==4  [aw=potential], cl(area_num)
	estadd local Model "OLS"
	estadd local covs "yes"
	estadd local base "yes"
	capture est sto `var'22	
	
* IV model for 2013 - No covariates
	
bootstrap, reps(250) seed(1712) cl(area_num) idcl(new_area_num) group(uniqueid) force: ivreg2 `var'D2 (IHEC = IVsm) `var'Pre if period==3 [aw=potential],  cl(area_num)
	estadd local Model "IV"
	estadd local covs "no"
	estadd local base "yes"
	capture est sto `var'IVsm19

* IV model for 2013 - With covariates

bootstrap, reps(250) seed(1712) cl(area_num) idcl(new_area_num) group(uniqueid) force: ivreg2 `var'D2 (IHEC = IVsm) `var'Pre $covs if period==3  [aw=potential],  cl(area_num)
	estadd local Model "IV"
	estadd local covs "yes"
	estadd local base "yes"
	capture est sto `var'IVsm20
	
* IV model for 2015 - No covariates
			
bootstrap, reps(250) seed(1712) cl(area_num) idcl(new_area_num) group(uniqueid) force: ivreg2 `var'D3 (IHEC = IVsm) `var'Pre if period==4  [aw=potential],  cl(area_num)
	estadd local Model "IV"	
	estadd local covs "no"
	estadd local base "yes"
	capture est sto `var'IVsm21

* IV model for 2015 - With covariates

bootstrap, reps(250) seed(1712) cl(area_num) idcl(new_area_num) group(uniqueid) force: ivreg2 `var'D3 (IHEC = IVsm) `var'Pre $covs if period==4 [aw=potential],  cl(area_num)
	estadd local Model "IV"
	estadd local covs "yes"
	estadd local base "yes"
	capture est sto `var'IVsm22
	
	}
	
	* Outsheeting results to create Table SI-10

	# delimit ;
		
		esttab BRB19 BRB20 BRB21 BRB22 BRBIVsm19 BRBIVsm20 BRBIVsm21 BRBIVsm22
		using "Tables/Table_SI-10.tex", replace
		keep(IHEC _cons)
		cells(b(fmt(%5.3f) star) se(fmt(%5.3f) par))
		starlevels(* .10 ** .05 *** .01) 
		mgroups( "\textbf{2013}" "\textbf{2015}" "\textbf{2013}" "\textbf{2015}", 
		pattern(1 0 1 0 1 0 1 0)
		span prefix(\multicolumn{@span}{c}{) suffix(}) erepeat(\cmidrule(lr){@span})) nomtitles
		varlabels(IHEC "IH (cumulative)" _cons "Constant")
		stats(Model covs base r2 N, labels("Model" "Covariates" "Base DV" "R2" "N")
		fmt(0 0 0 2 0)) collabels(none) label booktabs nonotes
		;
		#delimit cr		

